using System.Buffers;
using Vin.Extension.Framework.Dto;

namespace Vin.Extension.Framework.Monitor.Dto.Entities;

public record SysRequestLogDto : VinBaseEntityDto
{
    /// <summary>
    /// 当次请求Id
    /// </summary>
    public string? RequestId { get; set; }
    
    /// <summary>
    /// 控制器地址
    /// </summary>
    public string? ControllerPath { get; set; }

    /// <summary>
    /// Action地址
    /// </summary>
    public string? ActionPath { get; set; }

    /// <summary>
    /// 请求地址
    /// </summary>
    public string? RequestUrl { get; set; }

    /// <summary>
    /// 请求方法
    /// </summary>
    public string? RequestMethod { get; set; }

    /// <summary>
    /// 请求参数
    /// </summary>
    public string? RequestParams { get; set; }

    /// <summary>
    /// 请求体
    /// </summary>
    public string? RequestBody { get; set; }

    /// <summary>
    /// 请求头
    /// </summary>
    public string? RequestHeader { get; set; }

    /// <summary>
    /// 请求用户信息
    /// </summary>
    public string? RequestUser { get; set; }
    
    /// <summary>
    /// 请求用户名称
    /// </summary>
    public string? RequestUserName { get; set; }
    
    /// <summary>
    /// 请求用户ID
    /// </summary>
    public long? RequestUserId { get; set; }

    /// <summary>
    /// 请求curl
    /// </summary>
    public string? RequestCurl { get; set; }

    /// <summary>
    /// 响应码
    /// </summary>
    public int? ResponseCode { get; set; }

    /// <summary>
    /// 响应体
    /// </summary>
    public string? ResponseBody { get; set; }

    /// <summary>
    /// 异常信息
    /// </summary>
    public string? Exception { get; set; }

    /// <summary>
    /// 执行的SQL
    /// </summary>
    public string? Sql { get; set; }

    /// <summary>
    /// 请求ip
    /// </summary>
    public string? Ip { get; set; }

    /// <summary>
    /// 请求位置
    /// </summary>
    public string? Location { get; set; }

    /// <summary>
    /// 请求浏览器
    /// </summary>
    public string? Browser { get; set; }

    /// <summary>
    /// 请求操作系统
    /// </summary>
    public string? Os { get; set; }

    /// <summary>
    /// 请求代理
    /// </summary>
    public string? UserAgent { get; set; }

    /// <summary>
    /// 设备
    /// </summary>
    public string? Device { get; set; }

    /// <summary>
    /// 请求状态
    /// </summary>
    public OperationStatus? Status { get; set; }
    
    /// <summary>
    /// 消耗时间
    /// </summary>
    public long? CostTime { get; set; }

    /// <summary>
    /// 自定义消息
    /// </summary>
    public List<string>? CustomMsg { get; set; }
}